jQuery(document).ready(function($) {
    // change custom field
    $('.JsCustomFieldChange').livequery('change', function() {
        window.location.href = $(this).val();
    });
    
    // check all box
    $('input.JsListViewId').livequery('click', function() {
        if ($('input.JsListViewId:checked').val())
        {            
            $('input.listViewId').attr('checked', true);
        } else
        {         
            $('input.listViewId').removeAttr('checked');
        }
    });
    
    // delete item in list view
    $('.JsDeleteItem').livequery('click', function () {
        var n = $('input.listViewId:checked').length;
        
        if (n >= 1)
        {
            $('form.JsDeleteForm').submit();
        }            
    });
    
    // list date
    if ($('.pgDate').length > 0) 
    {
        $('.pgDate').livequery(function () {
            $(this).datepicker({ dateFormat: 'dd/mm/yy' });
        });
    }    
})